package namespace

import (
	"github.com/gin-gonic/gin"
	"krm_backend/controllers/namespace"
)

func add(namespaceGroup *gin.RouterGroup) {
	namespaceGroup.POST("/add", namespace.Create)
}

func list(namespaceGroup *gin.RouterGroup) {
	namespaceGroup.GET("/list", namespace.List)
}

func get(namespaceGroup *gin.RouterGroup) {
	namespaceGroup.GET("/get", namespace.Get)
}

func deleteNamespace(namespaceGroup *gin.RouterGroup) {
	namespaceGroup.POST("/delete", namespace.Delete)
}

func update(namespaceGroup *gin.RouterGroup) {
	namespaceGroup.POST("/update", namespace.Update)
}

func RegisterSubRouter(g *gin.RouterGroup) {
	namespace := g.Group("/namespace")
	add(namespace)
	list(namespace)
	get(namespace)
	deleteNamespace(namespace)
	update(namespace)
}
